<?php 
namespace app\common\model;
class MemberRealname extends Common{
	protected $insert = ['addtime'=>SYS_TIME];
	protected function getAddtimeAttr($value){
		return date("Y-m-d H:i", $value);
	}
	protected function getStatusAttr($value, $data){
		$status = [0=>'未审核',1=>'审核通过',2=>'被拒绝'];
		return $status[$data['status']];
	}
	protected function getSysManageAttr($value,$data){
		return "<a class='cocoModal' href='".url("images", ['id'=>$data['id']])."' title='身份证照片'  layerwidth='450px' layerheight='300px'>身份证照片</a> | <a class='cocoAjaxPost' href='Javascript:' confirm='确定要拒绝吗？' ajax-url=".url('update_status')." ajax-data='{  id:".$data['id'].",status:2}'>拒绝</a> | <a class='cocoAjaxPost' href='Javascript:' confirm='确定要通过吗？' ajax-url=".url('update_status')." ajax-data='{  id:".$data['id'].",status:1}'>通过</a>";
	}
	public function update_status($data){
	   return $this->where('id', $data['id'])->setField('status', $data['status']);

	}

}